package cn.wq.xa.service;

import cn.wq.xa.entity.User;
import cn.wq.xa.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    public UserMapper userMapper;


    public List<User> findByName(String name) {
        return userMapper.findUserByName(name);
    }

    public List<User> ListUser() {
        return userMapper.ListUser();
    }

    public User insertUser(User user) {
         userMapper.insertUser(user);
         return user;
    }

    public int delete(int id){
        return userMapper.delete(id);
    }


    public int Update(User user){
        return userMapper.Update(user);
    }
}
